package com.example.demo.hutool.bloomfilter;

import cn.hutool.bloomfilter.BitMapBloomFilter;

/**
 * hutool  布隆过滤器
 *
 * https://www.wenjiangs.com/doc/c7cfeayz
 *
 * https://www.cnblogs.com/z941030/p/9218356.html
 *
 * @author luowenjie
 * @since 2021/12/15 16:17
 */
public class HutoolBloomFilterTest {

    public static void main(String[] args) {
        // 初始化
        BitMapBloomFilter filter = new BitMapBloomFilter(100);
        filter.add("123");
        filter.add("abc");
        filter.add("ddd");

        // 查找
        System.out.println(filter.contains("abc"));
        System.out.println(filter.contains("abcd"));
    }

}
